<template>
  <div>
  <el-card
    shadow="never"
    style="border: none"
  >
    <div slot="header">
      <span>巡查记录</span>
    </div>
    <el-timeline>
      <el-timeline-item
        v-for="item in list"
        :key="item.id"
        :timestamp="parseTime(item.updateTime)"
        placement="top"
      >
        <el-card>
          <h4>整改措施：{{item.modifiedMethod}}</h4>
          <p>描述：{{item.description}}</p>
          <el-image
            v-for="fit in item.fileList"
            :key="fit.id"
            style="width: 100px; height: 100px; margin-right: 10px; margin-top: 10px;"
            :preview-src-list="item.fileList.map(p=>p.url)"
            :src="fit.url"
          ></el-image>
        </el-card>
      </el-timeline-item>
    </el-timeline>
  </el-card>
</div>
</template>
<script>
import { listItem} from "@/api/accident/item";
export default {
  name: "EventFlow",
  props: {
    accId: {
      type: String,
      required: true,
    },
    flush: {
      type: Number,
      default: 0,
    },
  },
  watch: {
    flush(newVal) {
      console.log(newVal);
      this.getList();
    }
  },
  data() {
    return {
      list: [],
      queryParams: {
        pageNo: 1,
        pageSize: 10,
        accId: null,
      },
    };


  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询【请填写功能名称】列表 */
    getList() {
      this.queryParams.accId = this.accId;
      listItem(this.queryParams).then(response => {
        this.list = response.data.records;
        this.total = response.data.total;
        this.loading = false;
      });
    }
  }
};
</script>

<style scoped>
.header_title{
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
</style>
